<?php

include('../classess/add_schedule.php');
$trainer_free_slot = new add_schedule();
include('../classess/scheduled_meeting.php');
$scheduled_trainee = new scheduled_meeting();

if (isset($_POST['get_trainer_slot']) && $_POST['get_trainer_slot'] != ''){
   
    $studentdetail = $scheduled_trainee->student_scheduled_array($_POST['user_id']," and a.user_id = " . $_POST['user_id']." and a.course_id = ".$_POST['course_id']."");
   
    $data  = $trainer_free_slot->schedule_all_detail("where t_status !=2 and  t_date = '".$_POST['date']."' and t_trainer_id = '".$studentdetail[0]['trainer_id']."'");
    
    
    $finalArray = array();
    $string = "<option value=''>Select Slot</option>";
    foreach($data as $_key => $_value){
        $string .= "<option value='".$_value['slot_id']."'>". $_value['course_slot']."</option>";
       
    }
    echo $string;
}

?>
